Repository navigation
fix(daemon): name a sandbox-denied loopback listen and point at host access - #5081
Conversation
…access A daemon whose loopback listen fails with EPERM or EACCES now exits with a typed listen-denied code. The client reports startup-listen-denied, does not retry, and its hint names the sandbox and the way out (allow agent-device in the agent's sandbox rules, or rerun with host access). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
Keeps startLocalDaemon under the Fallow cognitive-complexity ceiling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
The daemon change at 98f5e77 looks right, but the agent-facing help is now wrong for the exact case this PR targets. The CLI help at https://github.com/callstack/agent-device/blob/98f5e77/src/commands/schema/cli-help.ts#L421 and https://github.com/callstack/agent-device/blob/98f5e77/website/docs/docs/configuration.md#L146 list Not blocking, and fine to take or leave: the transport test at https://github.com/callstack/agent-device/blob/98f5e77/packages/daemon/src/server/http/transport.test.ts#L495 stops at the listen rejection, so nothing asserts that CI is green at this head. Body rules showed as cancelled in the first listing because editing the PR body cancels that job, and it passes on the later run. There are no conflicts. Not verified here: the CLI and daemon were not run under |
Narrows startup-exited to other causes in the help, the configuration page and the reason table, and checks the listen-denied rejection through daemonStartupExitCode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
At 97ac3f4 the code looks good, and the delta since the earlier review (98f5e77) only changes comments, help and docs strings and one test assertion. The earlier findings are now fixed, and no new problems were found. The listen path and the retry logic are unchanged since the earlier review, and they were re-read only to check the help and docs claims. Not verified here: the tests were not run locally. The only check that is not passing is Body rules, which was cancelled; it validates the PR description and metadata rather than code, and it looks like a superseded run. Re-running it should settle that, and once it passes the PR is ready to merge. No conflicts. |
Summary
Inside a coding-agent sandbox (for example Codex
workspace-write), the daemon's loopback listen fails withlisten EPERM. The CLI only said "Failed to start daemon … Read daemon.log", so agents gave up instead of asking for host access. The daemon now exits with a typed listen-denied code. The client reportsstartup-listen-denied, skips the retry, and the hint names the sandbox and the fix. The help and configuration docs list the new reason, andstartup-exitednow covers only other causes.Before / after
sandbox-exec -p '(version 1)(allow default)(deny network-bind)' agent-device devices --platform iosBefore (0.21.41):
After:
Validation
At 97ac3f4:
pnpm gate fallow,pnpm typecheck,pnpm lint, andtransport.test.ts(14 passed) all pass.daemon-client-startup-budget.test.tspassed at 98f5e77 and is unchanged since.Live check at f8cda79 (same hint text):
codex exec --approve-for-mewith gpt-6-luna on an iOS simulator. Before: 0/2 runs asked for host access. After: 2/2 asked and opened the app. The second run then hit the first run's leftover device claim, a harness issue.CI owns the full gates.
🤖 Generated with Claude Code